package CaseTraining;

public class CaseDemo01 {
    public static void main(String[] args) {
        double price = offer("经济舱", 9, 765);
        System.out.println(price);
    }
    public static double offer(String type, int month, double price){
        //判断当前月份是旺季还是淡季
        if(month >= 5 || month <= 10){
            //旺季
            //判断仓位类型和价格
            switch (type){
                case  "头等舱":
                    price *= 0.9;
                    break;
                case "经济舱" :
                    price *= 0.85;
                    break;
            }
        }else{
            //淡季
            //判断仓位类型和价格
            switch (type){
                case "头等舱":
                    price *= 0.7;
                    break;
                case "经济舱":
                    price *= 0.65;
                    break;
            }
        }
        return price;
    }
}
